@file:Suppress("UNUSED_EXPRESSION")

package top.fzqblog.function

import sun.management.snmp.jvminstr.JvmThreadInstanceEntryImpl.ThreadStateMap.Byte1.other

/**
 * Created by 抽离 on 2017/8/2 0002.
 */
val sum = {x: Int,y: Int -> x + y}

val all = fun Int.(other: Int): Int = this + other

val addAll :  Int.(other: Int) -> Int = {other -> this + other}

fun testAdd(x : Int, y : Int, add:(Int , Int) -> Int) {
    println("x：" + x)

    println("y：" + y)

    println("合为：" + add(x, y))
}

fun main(args: Array<String>) {

    println("：" + sum(1, 2))

    println("all：" + 1.all(2))

    1.addAll(2)

    testAdd(5, 5, addAll)
}